<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>跨域方案之代理</title>
  </head>
  <body>
    <button>点击请求代理服务器</button>
    <script>
      const btn = document.querySelector("button");
      btn.onclick = function () {
        fetch("http://localhost:9100/hero")
          .then(resp => resp.json())
          .then(res => {
            console.log(res);
          });
      };
    </script>
  </body>
</html>
